home *** CD-ROM | disk | FTP | other *** search
- ** this script uses the delay functions
-
- integer num, i;
- real delArray[];
-
- on simulate
- {
- con2out = delay(delArray, con1in);
-
- ** sysGlobal2 is the file reference number for the DEBUG TRACE
- if( sysGlobal2 != 0.0 ) ** 0 is error, check for open file for TRACE
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal2,"Delay Line block number "+(MyBlockNumber())+". Current Time:"+currentTime+".","",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal2,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- fileWrite(sysGlobal2," Input = "+con1In,"",True);
- fileWrite(sysGlobal2," Output = "+con2Out,"",True);
- fileWrite(sysGlobal2," ","",True);
- }
- }
-
- on endSim
- {
- disposeArray(delArray);
-
- ** sysGlobal1 is the file reference number for the TEXT REPORT
- if( sysGlobal1 != 0.0 ) ** 0 is error, check for open file for REPORT
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal1,"Delay Line block number "+(MyBlockNumber()),"",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal1,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- fileWrite(sysGlobal1," Delay Time = "+delayTime,"",True);
- if( comments != "" )
- fileWrite(sysGlobal1," Comments = "+comments,"",True);
- fileWrite(sysGlobal1," ","",True);
- }
- }
-
- on checkdata
- {
- if (novalue(delayTime))
- abort;
- }
-
-
- on stepsize
- {
- ** deltaTime should be delayTime or smaller
- ** Extend ignores negative or zero deltaTime values!
- deltaTime = delayTime;
- }
-
-
- on initsim
- {
- delayInit(delArray, delayTime);
- }
-
-
- on createmodule
- {
- delayTime = 0.0;
- }
-
-